package org.xinjiang.tarim.travel.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.xinjiang.tarim.travel.mapper.UserMapper;
import org.xinjiang.tarim.travel.model.User;
import org.xinjiang.tarim.travel.service.UserService;

import java.util.Date;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    @Override
    public User selectByPrimaryKey(String id) {
        return userMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<User> selectByPhone(String phone) {
        return userMapper.selectByPhone(phone);
    }

    @Override
    public int insert(User record) {
        return userMapper.insert(record);
    }

    @Override
    public int updateByPrimaryKeySelective(User record) {
        record.setModifyTime(new Date());
        return userMapper.updateByPrimaryKeySelective(record);
    }
}
